package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper

public interface SetmealDishMapper {


    List<Long>   selectByDishId(List<Long> dishIds);


    /**
     * 批量保存套餐和菜品的关联关系
     * @param setmealDishes
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 批量删除
     * @param setmealIds
     */
    void deleteBySetmealId(List<Long> setmealIds);

    /**
     * 根据 setmealId 查询setmeal_dish表数据
     * @param setmealId
     * @return
     */
    @Select("select * from  setmeal_dish where  setmeal_id =#{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

    /**
     * 根据setmeal_id 删除setmeal_dish 表中数据
     * @param setmealId
     */
    @Delete("delete from sky_take_out.setmeal_dish where dish_id=#{setmealId}")
    void delete(Long setmealId);
}
